#include <stdio.h>
long long A=1992919, B=18181971;
FILE *f;
char s[20];
int ts=1;
int next()
{
	A=(A*13166771+B)%1000000007;
	B=(B*67771+A)%1000000007;
	return A;
}
void createtest() { sprintf(s, "%03d", ts); ts++; f=fopen(s, "w"); }
void gen0()
{
	createtest();
	fprintf(f, "6 3 2\n");
	createtest();
	fprintf(f, "-1 0 1\n");
	createtest();
	fprintf(f, "1 1 1\n");
	createtest();
	fprintf(f, "3 4 1\n");
	createtest();
	fprintf(f, "3 4 5\n");
	createtest();
	fprintf(f, "3 4 6\n");
	createtest();
	fprintf(f, "10000 10000 1\n");
	createtest();
	fprintf(f, "10000 10000 10000\n");
}
void gen1()
{
	createtest();
	int x, y;
	for(; ; )
	{
		x=next()%20001-10000;
		y=next()%20001-10000;
		if(x || y) break;
	}
	fprintf(f, "%d %d %d\n", x, y, next()%10000+1);
}
void gen2()
{
	createtest();
	int x, y;
	for(; ; )
	{
		x=next()%20001-10000;
		y=next()%20001-10000;
		if(x || y) break;
	}
	fprintf(f, "%d %d %d\n", x, y, next()%20+1);
}
int main()
{
	int i;
	gen0();
	for(i=0; i<5; i++)
		gen1();
	for(i=0; i<5; i++)
		gen2();
	return 0;
}